package org.swift.commons.deployer.utils;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Enumeration;

public class ResourceUtils {

	private static ClassLoader webserviceClassloader;
	
	public static ClassLoader getWebserviceClassloader() {
		return webserviceClassloader;
	}
	
	public static void setWebserviceClassloader( ClassLoader classloader ) {
		webserviceClassloader = classloader;
	}
	
	public static InputStream getResourceAsStream(String name) {
		return webserviceClassloader.getResourceAsStream(name);
	}
	
	public static URL getResource(String name) {
		return webserviceClassloader.getResource(name);
	}
	
	public static Enumeration<URL> getResources(String name) throws IOException {
		return webserviceClassloader.getResources(name);
	}
	
}
